1. Field of the Invention
The present invention relates to a programmable controller and, more particularly, to a programmable controller with a function of extending inputs and outputs, in which a method of handling input and output numbers when an input/output organization is changed is improved.
2. Description of the Related Art
In general, a programmable controller is composed of a group of a CPU unit (block) which includes a microprocessor and various memories, and various standardized input units (blocks) or output units (blocks). As an input unit and an output unit, there are, for example, an eight-point type unit and a sixteen-point type unit as well as an input/output mixed unit with eight input points and eight output points, in which a necessary number of input units, output units and the like are selected and used according to the number of input and output points of a machine to be a target of control. These input/output units are put to practical use in various forms, for example, as an integral structure thereof connected by a CPU unit and a mother board (hereinafter referred to as form 1) or as a separate structure in which an input/output extension unit is externally connected to a main body unit that contains a CPU unit and a part of input/output units (hereinafter referred to as form 2).
In relation to a programmable controller belonging to the above-mentioned form 1, in Japanese Patent Laid-open No. 6-138916 (xe2x80x9cData Transfer Method of I/O modulexe2x80x9d), a programmable controller is configured to classify I/O modules (input/output units) into those for input and those for output to determine an address order in accordance with the connection order of slots connected thereto. Similarly to this method, in Japanese Patent Laid-open No. 5-46214 (xe2x80x9cBoard Connection Apparatus of Programmable Controllerxe2x80x9d), a programmable controller sends an allocation control signal by pin connection of cross-connected connectors in order to automatically execute allocation of input/output numbers of I/O extension boards, and each of the I/O extension boards receives a specific combination signal according to their connection order (see the above reference that describes a determining method of an order of connection).
In relation to a programmable controller belonging to the above-mentioned form 2, in Japanese Patent Laid-open No. 9-6418 (xe2x80x9cSetting Display Apparatusxe2x80x9d), an input/output unit externally attached to a programmable controller incorporated in a setting display apparatus is configured to set input and output numbers separately for input and output and in the order of connection, and a determination method of an order of connection is described. Similarly, in Japanese Patent Laid-open No. 5-274012 (xe2x80x9cProgrammable Controller for variably allocating input and outputxe2x80x9d), the programmable controller can change and set input/output allocation of I/O memories from time to time even if the number of a plurality of I/O devices connected via buses to the programmable controller or the number of words is changed, and each I/O device is provided with a station number setting unit.
According to the conventional art described above, when a connection organization of input/output units is changed, since a method of changing input and output numbers is uniform, input and output numbers cannot be freely allocated as desired by a user. For example, if two eight-point type input units are used and one of the input units is removed, it is reasonable to determine according to a user""s intention whether input numbers to be handled on a sequence program should be made missing numbers or these are automatically supplemented so as not to leave missing numbers. Similarly, if two eight-point type input units are used initially but one of them is changed to a sixteen-point type input unit to thereby have an extended input of total twenty-four points, more complicated options are required for a method of allocating input and output numbers.
In order to cope with this problem, some programmable controllers are provided with a parameter memory for defining types and arrangements of input/output units (the number of input points and the number of output points) and the top input and output numbers, so that a user can perform writing into a parameter memory at the stage of programming. With the parameter memory method, if an input and output arrangement is changed, the user can allocate input and output numbers as desired by rewriting the parameter memory according to the changed contents. However, since the writing operation is complicated, the parameter memory method is not suitable for a novice computer user who is unfamiliar with operations of a computer.
The present invention has been devised in view of the above and other drawbacks, and it is an object of the present invention to provide a programmable controller with which a user can easily allocate input and output numbers in a manner as intended by the user.
With the above object in view, the programmable controller of the present invention comprises a main body unit containing a microprocessor and various memories, the microprocessor operating in accordance with contents of a program memory in which a sequence program is stored and contents of a system memory in which a system program is stored to thereby generate a signal to an output device corresponding to a signal from an input device. The programmable controller comprises a plurality of input/output extension blocks connected to said main body unit. The programmable controller comprises block type identifying means that is provided in each of said input/output extension blocks and identifies a type and an arrangement of an input/output extension block which indicate the number of input and output points in said input/output extension block. Also provided are communication identifying means that is provided in each of said input/output extension blocks and identifies an input/output extension block communicating with said microprocessor and present organization storing means provided in said main body unit, which sequentially reads addresses of the input/output extension blocks with which communication is currently being conducted based on a result of identification by said communication identifying means, and stores input and output numbers corresponding to types and arrangements of input/output extension blocks obtained by said block type identifying means of the input/output extension blocks. Rewrite setting means that determines existence of an organization update instructing signal that is inputted from the outside following change, addition or removal of said input/output extension block and updates, in response to a result of the determination, contents of said present organization storing means by an allocation method selected from a plurality of predetermined allocation methods designated by said organization update instructing signal, is provided. Allocation of input/output numbers on said sequence program is carried out by a method selected from said plurality of allocation methods according to contents of said rewrite setting means. Therefore, since allocation of input/output numbers can be readily carried out by a learning operation without relying on rewriting of parameters as conventionally done, even a novice user who is unfamiliar with operations of a computer can easily allocate input/output numbers.